<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
		<link rel="stylesheet" href="css/home.css">
		<link rel="stylesheet" href="css/base.css">
		<link rel="stylesheet" type="text/css" href="css/paging.css">
		<script type="text/javascript" src="js/jquery-3.2.1.js"></script>
		<script type="text/javascript" src="js/index.js"></script>
		<script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
		<script type="text/javascript" src="js/page/query.js"></script>
		<script type="text/javascript" src="js/page/paging.js"></script>
		<script type="text/javascript" src="js/personInfro.js"></script>
		<title>全部舆情</title>
	</head>
	
	<body>
		<div class="wholePublic-box">
			<div class="wholePublic-header clearfix">
				<div class="wholePublic-logo fl">
					<a href="index-logged.html"><img src="images/logo-2.png" /></a>
				</div>
				<div class="wholePublic-header-list fl">
					<ul class="clearfix">
						<li class="wholePublic-border" onclick="javascript:window.location='wholePublic-company.html'">全部舆情</li>
						<li onclick="javascript:window.location='my-custom.html'">舆情定制</li>
						<li onclick="javascript:window.location='analysis.html'">分析报告</li>
						<li onclick="javascript:window.location='thinkTank.html'">智库</li>
						<li onclick="javascript:window.location='contactUs.html'">联系我们</li>
					</ul>
				</div>
				<div class="wholePublic-header-right fr">
					<ul class="clearfix">
						<li id="line"><img src="images/line-2.png" /></li>
						<li onclick="javascript:window.location='my-custom.html'">我的定制</li>
						<li id="exit"><img src="images/exit-2.png" /></li>
						<li class="setting-icon">
							<a href="company-setting.html"><img src="images/setting-icon.png" /></a>
						</li>
					</ul>
				</div>
			</div>
			<div class="grcolor-box"></div>
			<div class="wholePublic-mainBody clearfix">

				<div class="wholePublic-leftContent wholePublic-part1 fl" id="col1">
					<ul>
						<li onclick="javascript:window.location='wholePublic-company.html'"><img src="images/company-icon.png" /><span>企业舆情</span></li>
						<li onclick="javascript:window.location='wholePublic-product.html'"><img src="images/product-icon.png" /><span>产品舆情</span></li>
						<li onclick="javascript:window.location='wholePublic-hot.html'" class="wholePublic-selected"><img src="images/hot-icon-selected.png" /><span>热点舆情</span></li>
						<li onclick="javascript:window.location='wholePublic-collection.html'"><img src="images/collection-icon.png" /><span>舆情收藏</span></li>
					</ul>
				</div>
				<div class="wholePublic-rightContent fl">

					<!--热点舆情开始-->
					<div class="hot-box clearfix" id="hot_box">

						<!--来源微信-->
						<!--<div class="fl middle-part middle-part-1"  >
							<div class="anking">1</div>
							<div class="face-part-one clearfix">
								<div class="people_left fl">
									<img src="images/people_header.png" />
								</div>
								<div class="people-right fr">
									<div>企雷达产品正在试产试销中</div>
									<div class="grcolor clearfix author-time">
										<div class="fl author">鱼塘鱼塘作者名字</div>
										<div class="forum_time fr grcolor">3018-03-22</div>
									</div>
								</div>
							</div>
							<div class="clearfix">
								<div class="face_forum_content"><span class="positive">正</span>国睿科技和四创电子是中国电子科技集团有限公司下面两家非常典型的军民融合上市公司，由于两者都是雷达领域“国家队”标的， 常常被市场拿来进行比较。颇具14所的龙头风范与大哥地位，资产注入预期更为强烈。四创电子的灵活性国睿科技和四创电子是中国
								</div>
						
							</div>
							
							<div class="bottom-line"></div>
							
							<div class="Thermal_index clearfix">
								<div class="fl hot">
									<div class="fl header-hot-txt grcolor">热度指数</div>
									<div class="hot-progress fl">
										<div class="progress-val" id="bar_width">5642</div>
										<div class="progress-bar">
											<span class="progress-in" id="bar"></span>
										</div>
									</div>
								</div>
								<div class="keyword fl">
									<ul class="clearfix grcolor">
										<li>关键词：</li>
										<li>哔哩哔哩</li>
										<li>知乎</li>
										<li>用户群</li>
									</ul>
								</div>
								<div class="fl keyword ">
									<ul class="clearfix grcolor">
										<li>相关文章：</li>
										<li>54485</li>
									</ul>
								</div>
								<div class="fl keyword ">
									<ul class="clearfix grcolor">
										<li>来源：</li>
										<li>微信</li>
									</ul>
								</div>
								<div class="fr right-img"><span><img src="images/love-selected.png" /> </span><span><img src="images/share-icon.png" /></span></div>
							</div>
						</div>-->

						<!--来源微博-->
						<!--<div class="fl middle-part middle-part-2 weibo-part clearfix">
							<div class="anking">2</div>
							<div class="weibo-part-left fl">
								<img src="images/weibo.png" />
							</div>
							<div class="weibo-part-right fr" onclick="javascript:detail()">
								<div class="face-part-one clearfix">
									<div class="people_left fl">
										<img src="images/people_header.png">
									</div>
									<div class="people-right fr">
										<div>企雷达产品正在试产试销中</div>
										<div class="grcolor clearfix author-time">
											<div class="fl author">鱼塘鱼塘作者名字</div>
											<div class="forum_time fr grcolor">3018-03-22</div>
										</div>
									</div>
								</div>
								<div class="clearfix">
									<div class="face_forum_content"><span class="positive">正</span>国睿科技和四创电子是中国电子科技集团有限公司下面两家非常典型的军民融合上市公司，由于两者都是雷达领域“国家队”标的， 常常被市场拿来进行比较。颇具14所的龙头风范与大哥地位，资产注入预期更为强烈。四创电子的灵活性国睿科技和四创电子是中国
									</div>
							
								</div>
								
								<div class="bottom-line"></div>
								
								<div class="Thermal_index clearfix">
									<div class="fl hot">
										<div class="fl header-hot-txt grcolor">热度指数</div>
										<div class="hot-progress fl">
											<div class="progress-val" id="bar_width">5642</div>
											<div class="progress-bar">
												<span class="progress-in" id="bar"></span>
											</div>
										</div>
									</div>
									<div class="keyword fl">
										<ul class="clearfix grcolor">
											<li>关键词：</li>
											<li>哔哩哔哩</li>
											<li>知乎</li>
											<li>用户群</li>
										</ul>
									</div>
									<div class="fl keyword ">
										<ul class="clearfix grcolor">
											<li>相关文章：</li>
											<li>54485</li>
										</ul>
									</div>
									<div class="fl keyword ">
										<ul class="clearfix grcolor">
											<li>来源：</li>
											<li>微博</li>
										</ul>
									</div>
									<div class="fr right-img"><span><img src="images/love-selected.png"> </span><span><img src="images/share-icon.png"></span></div>
								</div>
							</div>
						</div>-->

						<!--来源于新闻-->
						<!--<div class="fl middle-part middle-part-3">
							<div class="anking">3</div>
							<div class="clearfix forum-header">
								<div class="fl positive">正</div>
								<p class="fl item-content2">
									<a href="#"><span class="item-content2-title">企雷达</span>产品正在试产试销中</a>
									<span class="item-content2-source">东方财富网</span>
								</p>
								<div class="forum_time fr grcolor">3018-03-22</div>
							</div>
							<div class="face_forum_content">国睿科技和四创电子是中国电子科技集团有限公司下面两家非常典型的军民融合上市公司，由于两者都是雷达领域“国家队”标的， 常常被市场拿来进行比较。颇具14所的龙头风范与大哥地位，资产注入预期更为强烈。四创电子的灵活性国睿科技和四创电子是中国
							</div>
							<div class="bottom-line"></div>
							<div class="Thermal_index clearfix">
								<div class="fl hot">
									<div class="fl header-hot-txt grcolor">热度指数</div>
									<div class="hot-progress fl">
										<div class="progress-val" id="bar_width">5642</div>
										<div class="progress-bar">
											<span class="progress-in" id="bar"></span>
										</div>
									</div>
								</div>
								<div class="keyword fl">
									<ul class="clearfix grcolor">
										<li>关键词：</li>
										<li>哔哩哔哩</li>
										<li>知乎</li>
										<li>用户群</li>
									</ul>
								</div>
								<div class="fl keyword ">
									<ul class="clearfix grcolor">
										<li>相关文章：</li>
										<li>54485</li>
									</ul>
								</div>
								<div class="fl keyword ">
									<ul class="clearfix grcolor">
										<li>来源：</li>
										<li>凤凰新闻</li>
									</ul>
								</div>
								<div class="fr right-img"><span><img src="images/love-selected.png"> </span><span><img src="images/share-icon.png"></span></div>
							</div>
						</div>
						-->

						<!--来源于论坛-->
						<!--<div class="fl middle-part">
							<div class="clearfix forum-header">
								<div class="fl positive">正</div>
								<div class="forum_title fl">哔哩哔哩和快手哪个更有前景？</div>
								<div class="forum_time fr grcolor">3018-03-22</div>
							</div>
							<div class="grcolor username">用户名字</div>
							<div class="neutral_forum_content">我相信，在知乎上，大家大多是更看好哔哩哔哩。因为哔哩哔哩和知乎的用户重合度很高，大家对哔哩哔哩会有比较深的感情。而快手</div>
							<div class="bottom-line"></div>
							<div class="Thermal_index clearfix">
								<div class="fl hot">
									<div class="fl header-hot-txt grcolor">热度指数</div>
									<div class="hot-progress fl">
										<div class="progress-val" id="bar_width">5642</div>
										<div class="progress-bar">
											<span class="progress-in" id="bar"></span>
										</div>
									</div>
								</div>
								<div class="keyword fl">
									<ul class="clearfix grcolor">
										<li>关键词：</li>
										<li>哔哩哔哩</li>
										<li>知乎</li>
										<li>用户群</li>
									</ul>
								</div>
								<div class="fl keyword ">
									<ul class="clearfix grcolor">
										<li>相关文章：</li>
										<li>54485</li>
									</ul>
								</div>
								<div class="fl keyword ">
									<ul class="clearfix grcolor">
										<li>来源：</li>
										<li>知乎</li>
									</ul>
								</div>
								<div class="fr right-img"><span><img src="images/love-selected.png" /> </span><span><img src="images/share-icon.png" /></span></div>
							</div>
						</div>-->
					</div>
					<!--热点舆情结束-->
					<div id="pageToolBox">
						<div id="pageTool"></div>
					</div>
				</div>
			</div>
		</div>
	</body>

</html>
<script>
	var token = sessionStorage.getItem('token');
	var useraccount = JSON.parse(token).useraccount;
	var userid = JSON.parse(token).id;
	var relHeight;
	var total;
	var num;
	
	$(document).ready(function() {
		content(data_1);
	});

	var Resize = function() {
		var doc = document.documentElement;
		relHeight = (doc.clientHeight > doc.scrollHeight) ? doc.clientHeight : doc.scrollHeight; //获取屏幕高度和当前页面高度中的较大值  
		document.getElementById('col1').style.height = relHeight - 82 + 'px'; //id为bg的div就是我页面中的遮罩层
	};
		
	var data_1 = JSON.stringify({
		'type': 3,
		'pageNum': 1,
		'emotion':'',
		'pageSize': 10,
	});
	function content(data) {
		num=1;
		$.ajax({
			type: "post",
			url: 'http://139.224.208.224:8080/qi-radar/cpSensation/getHotSensation',
			dataType: 'json',
			contentType: "application/json ",
			data: data,
			asycn: false,
			success: function(data) {
				if(data.code == 0) {
					total=data.total;
					var data = data.data.getNewsHotRank;
					console.log(data)
					var list = '';
					var newTime = [];
					var year = [];
					var month = []
					var day = [];
					var time = [];
					var times = [];
					for(var i = 0; i < data.length; i++) {
						var carNewsList = '';
						$.each(data[i].keyword, function(i, item) {
							carNewsList += "<li>" + item.keyword_name + "</li>";
						});

						newTime.push(new Date(data[i].content_time))
						year.push(newTime[i].getFullYear());
						month.push(newTime[i].getMonth() + 1);
						day.push(newTime[i].getDate());
						time.push((year[i] + "-" + month[i] + "-" + day[i]));
						times.push(time[i]);

						list += "<div class=\"fl middle-part middle-part-3\">";
						list += "<div class=\"clearfix forum-header\">";
						if(data[i].emotion == 1) {
							list += "<div class=\"fl positive\">正</div>";
						} else if(data[i].emotion == 2) {
							list += "<div class=\"fl negative\">负</div>";
						} else {
							list += "<div class=\"fl neutral\">中</div>";
						};
						list += "<p class=\"fl item-content2\">";
						list += "<a href=\"#\">" + data[i].title + "</a>";
						list += "</p>";
						list += "<div class=\"forum_time fr grcolor\">" + times[i] + "</div>";
						list += "</div>"
						list += "<div class=\"face_forum_content\">" + data[i].summary + "</div>";
						list += "<div class=\"bottom-line\"></div>";
						list += "<div class=\"Thermal_index clearfix\">";
						list += "<div class=\"fl hot\">";
						list += "<div class=\"fl header-hot-txt grcolor\">热度指数</div>";
						list += "<div class=\"hot-progress fl\">";
						list += "<div class=\"progress-val\" id=\"bar_width\">" + data[i].heat_value + "</div>";
						list += "<div class=\"progress-bar\">";
						list += "<span class=\"progress-in\" id=\"bar\"></span>";
						list += "</div>";
						list += "</div>";
						list += "</div>";
						list += "<div class=\"keyword fl\">";
						list += "<ul class=\"clearfix grcolor\">";
						list += "<li>关键词：</li>";
						list += carNewsList;
						//						list+="<li>"+data[i].keyword[0].keyword_name+"</li>";
						//						list+="<li>"+data[i].keyword[0].keyword_name+"</li>";
						list += "</ul>";
						list += "</div>";
						list += "<div class=\"fl keyword \">";
						list += "<ul class=\"clearfix grcolor\">";
						list += "<li>相关文章：</li>";
						list += "<li>" + data[i].read_num + "</li>";
						list += "</ul>";
						list += "</div>";
						list += "<div class=\"fl keyword \">";
						list += "<ul class=\"clearfix grcolor\">";
						list += "<li>来源：</li>";
						list += "<li>" + data[i].source + "</li>";
						list += "</ul>";
						list += "</div>";
						list += "<div class=\"fr right-img\"><span><img src=\"images/love.png\" class=\"collection\"  data-id=\"" + data[i].id + "\"> </span><span><img src=\"images/share-icon.png\"></span></div>";
						list += "</div>";
						list += "</div>";
					};
					$("#hot_box").html(list);
					if(num==1){
						$('#hot_box').find(".middle-part-3").eq(0).append("<div class=\"anking\">1</div>");
						$('#hot_box').find(".middle-part-3").eq(1).append("<div class=\"anking\">2</div>");
						$('#hot_box').find(".middle-part-3").eq(2).append("<div class=\"anking\">3</div>");
					};
					paged();
					if(total>10){
						$("#pageToolBox").show();
					};
					Resize();
					//舆情收藏
					$(".collection").click(
						function() {
							if(!this.toggle) {
								$(this).attr("src", "images/love-selected.png");
								var id = $(this).attr('data-id');
								this.toggle = true;
								var datas = {
									'uc_useraccount': useraccount,
									'uc_articleid': id,
									'uc_mediatype': 3,
								};
								var data = JSON.stringify(datas)
								$.ajax({
									type: "post",
									url: 'http://139.224.208.224:8080/qi-radar/cpSensation/addCollection',
									dataType: 'json',
									contentType: "application/json ",
									data: data,
									asycn: false,
									success: function(data) {
										console.log(data)
										if(data.code == 0) {
											alert("收藏成功")
										}
									}
								});
							} else {
								$(this).attr("src", "images/love.png");
								var id = $(this).attr('data-id');
								this.toggle = false;
								var datas = {
									'uc_useraccount': useraccount,
									'uc_articleid': id,
									'uc_mediatype': 3,
								};
								var data = JSON.stringify(datas)
								$.ajax({
									type: "post",
									url: 'http://139.224.208.224:8080/qi-radar/cpSensation/delCollection',
									dataType: 'json',
									contentType: "application/json ",
									data: data,
									asycn: false,
									success: function(data) {
										console.log(data)
										if(data.code == 0) {
											alert("取消成功")
										}
									}
								});
							}
						}
					);

				} else {
					alert(data.errMsg)
				};
			}
		});
	};
	paged();
	//分页
	var pages;
	function paged() {
		$('#pageTool').empty();
		$('#pageTool').Paging({
			pagesize: 10,
			count:total,
			current:pages,
			callback: function(page, size, count) {
				var data = JSON.stringify({
					'type': 3,
					'pageNum': page,
					'pageSize': 10,
				});
				pages=page;
				content(data);
				var pageUrl = window.location.href;
				if(pageUrl.lastIndexOf("=") != -1) {
					var page = pageUrl.split("=");
					num = page[1];
				};
			}
		});
	};
	
	window.onload = function() {
		Resize();
		window.onresize = function() {
			Resize()
		};
	};
	window.refresh=function(){
		
	}
</script>